package com.tarena.youlu.adapter;

import java.util.ArrayList;
import java.util.List;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.tarena.youlu.fragment.CalllogFragment;
import com.tarena.youlu.fragment.ContactFragment;
import com.tarena.youlu.fragment.DialFragment;
import com.tarena.youlu.fragment.SmsFragment;

public class MyPagerAdapter extends FragmentPagerAdapter{
	
	List<Fragment> fragments;
	
	public MyPagerAdapter(FragmentManager fm) {
		super(fm);
		fragments = new ArrayList<Fragment>();
		fragments.add(new CalllogFragment());
		fragments.add(new ContactFragment());
		fragments.add(new SmsFragment());
		fragments.add(new DialFragment());
	}
	
	public MyPagerAdapter(FragmentManager fm,List<Fragment> fragments) {
		super(fm);
		this.fragments = fragments;
	}
	
	@Override
	public Fragment getItem(int arg0) {
		return fragments.get(arg0);
	}

	@Override
	public int getCount() {
		return fragments.size();
	}

}
